]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Fix some splice mishaps
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 26 Apr 2013 05:34:50 +0000 (01:34 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 26 Apr 2013 16:16:06 +0000 (12:16 -0400)
Calling splice() without a second argument removes all of the elements
after the provided index, not just one.

https://bugzilla.gnome.org/show_bug.cgi?id=698918

js/ui/status/network.js

index cb524581797b7e11ea82905e8a831853e2645cf1..2cef443b9a9902f1d7f565a127bf53c558077fa1 100644 (file)
@@ -1266,7 +1266,7 @@ const NMDeviceWireless = new Lang.Class({
             for (let k = 0; k < connections.length; k++) {
                 if (connections[k].get_uuid() == connection.get_uuid()) {
                     // remove the connection from the access point group
-                    connections.splice(k);
+                    connections.splice(k, 1);
                     forceupdate = forceupdate || connections.length == 0;
 
                     if (forceupdate)
@@ -2120,7 +2120,7 @@ const NMApplet = new Lang.Class({
     _connectionRemoved: function(connection) {
         let pos = this._connections.indexOf(connection);
         if (pos != -1)
-            this._connections.splice(connection);
+            this._connections.splice(connection, 1);
 
         let section = connection._section;